<template>

	<!-- 搜索 -->
	<Home-search></Home-search>
	<!-- 轮播 -->
	<Home-swipe :banner="banner"></Home-swipe>
	<!-- 页面导航 -->
	<HomeGrid :channel="channel"></HomeGrid>
	<!-- 内容 -->
	<home-content 
		:brandList="brandList" 
		:newGoodsList="newGoodsList" 
		:hotGoodsList="hotGoodsList"
		:topicList="topicList"
		>
	</home-content>
	<div v-for="item in categoryList" :key="item.id">
		<home-wei :goodsList="item.goodsList" :title="item.name"></home-wei>
	</div>

</template>

<script>
import axios from 'axios'
import HomeGrid from '../components/HomeGrid.vue'
import HomeSearch from '../components/HomeSearch.vue'
import HomeSwipe from '../components/HomeSwipe.vue'
import HomeContent from '../components/HomeContent.vue'
import HomeWei from '../components/HomeWei.vue'
export default {
  components: { HomeSwipe, HomeSearch, HomeGrid, HomeContent, HomeWei },
  data(){
		return {
			banner:[],  // 轮播
			channel:[],	// 页面导航
			brandList:[],	// 品牌制造商   
			newGoodsList:[],   // 新品首发
			hotGoodsList:[],	// 人气推荐
			topicList:[],	// 专题精选
			categoryList:[],	// 居家
		}
	},
	created(){
		axios.get("/api/index/index").then((res)=>{
			console.log(res);
			this.banner=res.data.data.banner
			this.channel=res.data.data.channel
			this.brandList=res.data.data.brandList
			this.newGoodsList=res.data.data.newGoodsList
			this.hotGoodsList=res.data.data.hotGoodsList
			this.topicList=res.data.data.topicList
			this.categoryList=res.data.data.categoryList
		})
	}
}
</script>
<style scoped>

</style>